package com.heima.user.controller;

import com.heima.client.user.IUserClient;
import com.heima.model.common.dtos.AuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.AuthService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/auth")
@Slf4j
@Api(tags = "app用户认证审核")
public class AuthController implements IUserClient {

    @Autowired
    private AuthService authService;

    /**
     * 分页查询用户认证信息列表
     *
     * @return
     */
    @PostMapping("/list")
    public ResponseResult authList(@RequestBody AuthDto dto) {
        log.info("分页查询用户认证信息列表：{}",dto);
        return authService.authList(dto);
    }

    /**
     * 认证审核通过
     *
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        log.info("认证审核通过：{}",dto);
        return authService.authPass(dto);
    }

    /**
     * 认证审核失败
     *
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        log.info("认证审核失败：{}",dto);
        return authService.authFail(dto);
    }



}
